package net.qunzhi.modules.cms.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import net.qunzhi.common.utils.BaseQuery;
import net.qunzhi.common.annotation.SysLog;
import net.qunzhi.modules.cms.dao.TbPressureStateDao;
import net.qunzhi.modules.cms.query.StateDateQuery;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.qunzhi.modules.cms.entity.TbPressureStateEntity;
import net.qunzhi.modules.cms.service.TbPressureStateService;
import net.qunzhi.common.utils.PageUtils;
import net.qunzhi.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 调度中心压力数据
 *
 * @author zjr
 * @date 2021-09-10 15:48:00
 */
@Api(tags = "调度中心压力数据相关")
@RestController
@RequestMapping("cms/tbPressureState")
public class TbPressureStateController {
    @Autowired
    private TbPressureStateService tbPressureStateService;
    @Autowired
    private TbPressureStateDao pressureStateDao;

    /**
     * 列表
     */
    @ApiOperation("列表")
    @GetMapping("/list")
    @RequiresPermissions("cms:tbPressureState:list")
    public R list(StateDateQuery query){
        PageUtils page = tbPressureStateService.queryPage(query);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @ApiOperation("信息")
    @GetMapping("/info/{id}")
    @RequiresPermissions("cms:tbPressureState:info")
    public R info(@PathVariable("id") Integer id){
		TbPressureStateEntity tbPressureState = tbPressureStateService.getById(id);

        return R.ok().put("tbPressureState", tbPressureState);
    }

    /**
     * 修改
     */
    @ApiOperation("修改")
    @SysLog("调度中心压力数据修改")
    @PostMapping("/update")
    @RequiresPermissions("cms:tbPressureState:update")
    public R update(@RequestBody TbPressureStateEntity tbPressureState){
		tbPressureStateService.updateById(tbPressureState);

        return R.ok();
    }

}
